feat: Add RefundByEntitlementIds endpoint (POST /game/refund/v1)#435
Open
feat: Add RefundByEntitlementIds endpoint (POST /game/refund/v1)#435
Conversation
Co-authored-by: kirre-bylund <4068377+kirre-bylund@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement refund endpoint for Unity SDK
feat: Add RefundByEntitlementIds endpoint
Mar 6, 2026
Copilot
AI
changed the title
feat: Add RefundByEntitlementIds endpoint
feat: Add RefundByEntitlementIds endpoint (POST /game/refund/v1)
Mar 6, 2026
kirre-bylund
requested changes
Mar 6, 2026
Contributor
kirre-bylund
left a comment
There was a problem hiding this comment.
@copilot review complete, please adress.
Co-authored-by: kirre-bylund <4068377+kirre-bylund@users.noreply.github.com>
Contributor
Author
All three string fields converted to enums in commit 4318242:
|
kirre-bylund
approved these changes
Mar 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LootLockerRefundInventoryEventActionenum (removed,skipped) forLootLockerRefundPlayerInventoryEvent.actionLootLockerRefundNonReversibleRewardKindenum (progression_points,progression_reset) forLootLockerRefundNonReversibleReward.kindLootLockerRefundWarningTypeenum (non_reversible_rewards,insufficient_funds,already_refunded,refund_failed) forLootLockerRefundWarningDetail.typeaction,kind, andtypeproperties fromstringto their respective enum typesOriginal prompt
Summary
Implement the refund endpoint for the Unity SDK as described in lootlocker/index#1395.
The tracking issue is https://github.com/lootlocker/index/issues/1395. Per the lifecycle instructions: as soon as the PR is opened, post a comment on the tracking issue with the PR link, and update the tracking issue's project status to In Review.
API Specification
Endpoint:
POST /game/refund/v1Request body:
{ "entitlement_ids": ["<ULID>", ...] }Response (200):
{ "player_inventory_events": [ { "asset_id": 123, "name": "Item Name", "action": "removed" | "skipped" } ], "currency_refunded": [ { "currency_id": "<ULID>", "currency_code": "gold", "amount": "500" } ], "currency_clawback": [ { "currency_id": "<ULID>", "currency_code": "gold", "amount": "500" } ], "warnings": [ { "entitlement_id": "<ULID>", "details": [ { "type": "non_reversible_rewards" | "insufficient_funds" | "already_refunded" | "refund_failed", "message": "Human-readable explanation", "rewards": [ { "kind": "progression_points" | "progression_reset", "id": "<ULID>", "name": "Progression name", "amount": "100" } ] } ] } ] }What needs to be implemented
1.
Runtime/Client/LootLockerEndPoints.csAdd a new endpoint under the
// Purchasesection (after the existing purchase endpoints):2.
Runtime/Game/Requests/PurchaseRequest.csFollowing the existing patterns in this file:
In
namespace LootLocker.Requests, add: